﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

using CE.User;
using CE.Global;
public partial class _404 : MyLanguageBasePage
{
    protected override void InitializeCulture()
    {
        //String selectedCulture = CE.Global.General.SetCulture();
        ////UICulture = selectedCulture;
        //Culture = selectedCulture;
        //base.InitializeCulture();

        string selectedLanguage = string.Empty;
        if (Session["Language"] != null)
        {
            selectedLanguage = Session["Language"].ToString();
        }
        else
        {
            selectedLanguage = "th-TH";
            Session["Language"] = selectedLanguage;
        }
        
        base.InitializeCulture();

    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            Page.Response.StatusCode = 404;
            //Response.Message = "Page not found";

            if (Request.Params["aspxerrorpath"] != null)
            {
                //aspxerrorpath=/en/home1.aspx
                LogUserViewedHistory("Requested page: " + Request.Params["aspxerrorpath"].ToString());
            }
            else
            {
                LogUserViewedHistory(" No aspxerrorpath argument.");
            }
        }
    }

    private void LogUserViewedHistory(string Description)
    {
        UserViewHistoryDB _userviewdb = new UserViewHistoryDB();
        _userviewdb.LogViewedHistory("404", Request, "404 - " + Description);
    }
}
